﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeScale3d : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeScale3d(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeScale3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeScale3d()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeScale3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public override string ToString()
		{
			if (this.swigCPtr.Handle == IntPtr.Zero)
			{
				return "Empty";
			}
			return string.Format("({0},{1},{2})", this.sx, this.sy, this.sz);
		}

		public OdGeScale3d() : this(GlobalsPINVOKE.new_OdGeScale3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeScale3d(OdGeScale3d source) : this(GlobalsPINVOKE.new_OdGeScale3d__SWIG_1(OdGeScale3d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeScale3d(double factor) : this(GlobalsPINVOKE.new_OdGeScale3d__SWIG_2(factor), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeScale3d(double xFactor, double yFactor, double zFactor) : this(GlobalsPINVOKE.new_OdGeScale3d__SWIG_3(xFactor, yFactor, zFactor), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeScale3d Assign(OdGeScale3d scaleVec)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_Assign(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGeScale3d kIdentity
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGeScale3d_kIdentity_get();
				OdGeScale3d result = (intPtr == IntPtr.Zero) ? null : new OdGeScale3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public OdGeScale3d Mul(OdGeScale3d scaleVec)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_Mul__SWIG_0(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d Mul(double factor)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_Mul__SWIG_1(this.swigCPtr, factor), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d setToProduct(OdGeScale3d scaleVec1, OdGeScale3d scaleVec2)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_setToProduct__SWIG_0(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec1), OdGeScale3d.getCPtr(scaleVec2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d setToProduct(OdGeScale3d scaleVec, double factor)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_setToProduct__SWIG_1(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec), factor), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d inverse()
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_inverse(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d invert()
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_invert(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isProportional(OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_isProportional__SWIG_0(this.swigCPtr, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isProportional()
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_isProportional__SWIG_1(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGeScale3d scaleVec)
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_IsEqual(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGeScale3d scaleVec)
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_IsNotEqual(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGeScale3d scaleVec, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_isEqualTo__SWIG_0(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGeScale3d scaleVec)
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_isEqualTo__SWIG_1(this.swigCPtr, OdGeScale3d.getCPtr(scaleVec));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double GetItem(uint i)
		{
			double result = GlobalsPINVOKE.OdGeScale3d_GetItem__SWIG_0(this.swigCPtr, i);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d set(double xFactor, double yFactor, double zFactor)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_set(this.swigCPtr, xFactor, yFactor, zFactor), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getMatrix(OdGeMatrix3d xfm)
		{
			GlobalsPINVOKE.OdGeScale3d_getMatrix(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeScale3d extractScale(OdGeMatrix3d xfm)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_extractScale(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeScale3d removeScale(OdGeMatrix3d xfm)
		{
			OdGeScale3d result = new OdGeScale3d(GlobalsPINVOKE.OdGeScale3d_removeScale(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isValid()
		{
			bool result = GlobalsPINVOKE.OdGeScale3d_isValid(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double sx
		{
			get
			{
				double result = GlobalsPINVOKE.OdGeScale3d_sx_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGeScale3d_sx_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double sy
		{
			get
			{
				double result = GlobalsPINVOKE.OdGeScale3d_sy_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGeScale3d_sy_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double sz
		{
			get
			{
				double result = GlobalsPINVOKE.OdGeScale3d_sz_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGeScale3d_sz_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
